<template>
  <div>
    <tr>
      <td>用户名：</td>
      <td><input type="text" v-model="name"></td>
    </tr>
    <tr>
      <td>手机号：</td>
      <td>86<input type="text" v-model="shouji"></td>
    </tr>
    <button @click="tijiao">验证</button>
  </div>
</template>

<script>
    export default {
        name: "ding",
      data:function () {
        return{
          name:'',
          shouji:''
        }
      },
      methods:{
          tijiao:function () {
            this.axios({
              url:'http://127.0.0.1:8000/ding/',
              method:'get',
              params:{name:this.name, shouji: this.shouji, uid:localStorage.getItem('uid')}
            }).then(res=>{
              if(res.data.code===200){
                console.log(res.data.message);
                localStorage.setItem('name', res.data.name);
                localStorage.setItem('shouji', res.data.shouji);
                this.$router.push('dan')
              }else {
                alert(res.data.message);
                console.log(res.data.message)
              }
            });
          },

      }
    }
</script>

<style scoped>

</style>
